//
//  NewestDynamicCell.swift
//  HuaYun
//
//  Created by enghou on 2018/11/29.
//  Copyright © 2018 xyxorigation. All rights reserved.
//

import UIKit

class NewestDynamicCell: UITableViewCell {

    @IBOutlet weak var nameLbl: UILabel!
    @IBOutlet weak var timeLbl: UILabel!
    @IBOutlet weak var contentLbl: UILabel!
    var _model: JSON?
    var model: JSON? {
        set{
            _model = newValue
            nameLbl.text = _model?.contents?["name"]?.rawString()
            let timestamp = _model?.contents?["createTime"]?.double ?? 0.0
            let date = Date.init(timeIntervalSince1970: timestamp / 1000)
            self.timeLbl.text = date.dateStr
            contentLbl.text = _model?.contents?["notes"]?.rawString()
        }
        get{
            return _model
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
